﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GameForm.Gamelib
{
    public class 抓鬼Task : TaskBase
    {
        protected override async Task<bool> OnMainGame()
        {
            if (await api.Ck_移动中())
                return true;
            if (api.Dlg_主界面_IsOpen())
            {
                await base.OnMainGame();
                await api.Action_队友状态检测(false);
                await Task.Delay(1000);
                if (await api.Dlg_快捷任务_选中())
                {
                    if(!await api.Action_点击任务())
                    {
                        //领任务
                        await api.Action_点击活动任务("抓鬼");
                    }
                }
            }
            return true;
        }

        protected override async Task<bool> OnKillIng()
        {
            if (await api.Action_关闭无干扰框())
                return true;
            await api.Action_队友状态检测(true);
            if (api.CheckColor(371, 48, "ffe699"))
            {
                api.LeftClick(371, 48);
                await Task.Delay(1000);
            }
            return await base.OnKillIng();
        }

        protected override async Task<bool> OnOther()
        {
            if (await api.Action_抓鬼_缺人_自动匹配())
                return true;
            else if (await api.Action_抓鬼_没有辅助门派())
                return true;
            else if (await api.Action_继续抓鬼())
                return true;
            return await base.OnOther();
        }
    }
}
